package com.beiding.jsonanalyzer.flow;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 本地线程执行任务
 *
 * @author 丁常磊
 * @date 2022/5/12 11:01
 */

public class LocalTreadTaskSlot implements TaskSlot {

    private ExecutorService executor = Executors.newSingleThreadExecutor();


    public void drop() {
        executor.shutdown();
    }

    @Override
    public void commit(Runnable task) {
        executor.submit(task);
    }
}
